<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="number" id='buy' placeholder="买入价"/>-<input type="number" id="num" placeholder="手数"/>-<input type="number" id="sell" placeholder="卖出价"/>
		<button onclick="getResult();">计算</button>
		<div id="result"></div>
		
	</body>
</html>

<script>
	function getResult(){
		let buy = getVal("buy");
		let num = getVal("num");
		let sell = getVal("sell");
		let result = sell*num-(sell*num*0.001)-10-buy*num;
		document.getElementById('result').innerText="结果："+result;
	}
	function getVal(id){
		
		return parseFloat(document.getElementById(id).value);
	}
</script>
